package com.net.xpay.core.domain;

import com.net.common.domain.VersionedDomain;
import com.net.xpay.core.enums.PayTransStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 2020/4/29 14:54

 * 单批次下的交易记录
 */
@Getter
@Setter
@NoArgsConstructor
public class PayTransRecord extends VersionedDomain {
    @ApiModelProperty(notes = "用户id")
    private Long userId;

    @ApiModelProperty(notes = "注册手机号")
    private String mobile;

    @ApiModelProperty(notes = "合伙人id")
    private Long partnerId;

    @ApiModelProperty(notes = "是否是代转账")
    private Boolean otherTrans;

    @ApiModelProperty(notes = "转账执行人id")
    private Long executeUserId;

    @ApiModelProperty(notes = "转账执行人外部id")
    private String executeOuterId;

    @ApiModelProperty(notes = "转账执行人手机号")
    private String executeMobile;

    @ApiModelProperty(notes = "支付宝账号id")
    private Long alipayUserId;

    @ApiModelProperty(notes = "支付宝账号")
    private String alipayNickName;

    @ApiModelProperty(notes = "payTransId")
    private Long payTransId;

    @ApiModelProperty(notes = "支付宝发起支付后返回的 支付宝批次订单号")
    private String batchTransId;

    @ApiModelProperty(notes = "summaryId")
    private Long summaryId;

    @ApiModelProperty(notes = "payTransBatchId")
    private Long payTransBatchId;

    @ApiModelProperty(notes = "商户的批次号 必选 user.id + '-' + pay_trans_summary.id")
    private String outBatchNo;

    @ApiModelProperty(notes = "导入的商户的批次号 非必选")
    private String importBatchNo;

    @ApiModelProperty(notes = "明细外部订单号 必选  user_id + '-' + pay_trans.id")
    private String outBizNo;

    @ApiModelProperty(notes = "导入的明细外部订单号 非必选")
    private String importBizNo;

    @ApiModelProperty(notes = "明细金额 单位为元（最小1元），精确到小数点后两位 必选")
    private String transAmount;

    @ApiModelProperty(notes = "转账备注，收款方如果是支付宝账号，会展示在收款方账单里 非必选")
    private String remark;

    @ApiModelProperty(notes = "收款方账号，传入支付宝账号或者支付宝uid test@taobao.com 必选")
    private String identity;

    @ApiModelProperty(notes = "1.当identity传入支付宝账号时，identity_type传ALIPAY_LOGON_ID 2.当当identity传入支付宝uid时，identity_type传ALIPAY_USER_ID 必选")
    private String identityType;

    @ApiModelProperty(notes = "参与方真实姓名，如果非空，将校验收款支付宝账号姓名一致性。当identity_type传ALIPAY_LOGON_ID时此字段必选")
    private String name;

    @ApiModelProperty("状态")
    private PayTransStatus status;

    @ApiModelProperty(notes = "完成时间")
    private LocalDateTime endTime;

    @ApiModelProperty(notes = "支付宝系统内部明细单号")
    private String detailId;

    @ApiModelProperty(notes = "明细失败错误码")
    private String errorCode;

    @ApiModelProperty(notes = "明细失败错误原因")
    private String errorMsg;

    public static PayTransRecord getInstance() {
        PayTransRecord record =new PayTransRecord();
        record.setOtherTrans(false);
        return record;
    }
}
